package store.lunangangster.bpmn.converter;

import javax.xml.stream.XMLStreamReader;
import store.lunangangster.bpmn.model.BpmnModel;
import store.lunangangster.bpmn.model.ParallelGateway;
import store.lunangangster.bpmn.util.BpmnXmlUtil;

public class ParallelGatewayConverter extends GatewayConverter {

  @Override
  protected ParallelGateway convertToElement(XMLStreamReader xsr, BpmnModel model) throws Exception {
    ParallelGateway parallelGateway = new ParallelGateway();
    BpmnXmlUtil.addXmlLocation(xsr, parallelGateway);
    parseGatewayAttribute(xsr, parallelGateway);
    parseChildElement(xsr, parallelGateway, getTargetName(), model);
    return parallelGateway;
  }

  @Override
  public String getTargetName() {
    return ELEMENT_GATEWAY_PARALLEL;
  }
}
